package com.atguigu.sms.consumer;

import com.atguigu.servicebase.RabbitMQConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@RabbitListener(queuesToDeclare = @Queue(RabbitMQConfig.RABBITMQ_DEMO_TOPIC))
@Slf4j
public class RabbitMQConsumer {

    @RabbitHandler
    public void process(Map map) {
        log.info("消费者从 RabbitMQ服务器消费消息：" + map.toString());
    }
}
